package com.xgst.runningmanager

import android.content.Intent
import com.bumptech.glide.Glide
import com.xgst.baselib.BaseActivity
import com.xgst.runningmanager.databinding.ActivityErrorDetailBinding
import com.xgst.runningmanager.databinding.ActivityOrderDetailBinding

class ErrorDetailActivity:BaseActivity<ActivityErrorDetailBinding>() {
    override fun init() {
        binding.etTitle.text = intent.getStringExtra("title")
        binding.tvUseName.text = intent.getStringExtra("tvUseName")
        binding.etQ.text = intent.getStringExtra("tvQ")
        binding.tvTime.text = intent.getStringExtra("tvTime")
        val file = intent.getStringExtra("attachFile")
        Glide.with(this).load(file).into(binding.imgAdd)

        binding.imgAdd.setOnClickListener {
            if(file?.endsWith("mp4") == true){
                VideoActivity.startActivity(file)
            }else{
                val intent = Intent(this,ImageAcitivity::class.java)
                intent.putExtra("url",file)
                startActivity(intent)
            }
        }
    }
}